var nestedList = new Ext.NestedList({
    fullscreen: true,
    title: 'Favorites',
    id:'favTool',
    //displayField: 'text',
    store: favStore,
    getDetailCard: function(item, parent) {       
        //console.log(item.attributes.record.data);
        //console.log(parent)
        //return;
        var itemData = item.attributes.record.data,
        //parentData = parent.attributes.record.data,
        detailCard = new Ext.Panel({
            scroll: 'vertical',
            styleHtmlContent: true,
            tpl: ["<h2>{text}</h2>","{date}","{content}"]
        });
        detailCard.update(itemData);
        this.backButton.setText(itemData.text);
        return detailCard;
    },
    getItemTextTpl:function(){
        var tplConstructor = '{text}' +
            '<tpl for=".">'+
                '<div class="metadata">' +
                    ' {date}' +
                '</div>' +
            '</tpl>';
        return tplConstructor;
    }
});

var toolbarList = {
    xtype:'toolbar',
    title:"Favorites"
}

//Favorites
DC.views.fav = Ext.extend(Ext.Panel,{
    title:'Favorites',
    iconCls:'favorites_dc',
    items:[
        toolbarList,
        nestedList
    ]
});
Ext.reg('fav', DC.views.fav);
